package com.xsomnus.open.im.authv2.codec;

import com.xsomnus.open.im.protocol.Packet;
import com.xsomnus.open.im.protocol.codec.PacketCodec;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToByteEncoder;

/**
 * @author @xsomnus666_xiawenye★
 * @since 2019/4/25 0025 15:31
 * 当你发现自己的才华撑不起野心时，就请安静下来学习吧
 */
public class PacketEncoder extends MessageToByteEncoder<Packet> {
    @Override
    protected void encode(ChannelHandlerContext ctx, Packet msg, ByteBuf out) throws Exception {
        PacketCodec.INSTANCE.encode(out, msg);
    }
}
